inherited fmAddP: TfmAddP
  Left = 478
  Top = 176
  Width = 325
  Height = 539
  Caption = #1044#1086#1073#1072#1074#1080#1090#1100' '#1095#1077#1083#1086#1074#1077#1082#1072
  Constraints.MinHeight = 539
  Constraints.MinWidth = 325
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object Label2: TLabel [0]
    Left = 17
    Top = 39
    Width = 44
    Height = 13
    Caption = #1060#1072#1084#1080#1083#1080#1103
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label31: TLabel [1]
    Left = 17
    Top = 85
    Width = 19
    Height = 13
    Caption = #1048#1084#1103
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label3: TLabel [2]
    Left = 17
    Top = 128
    Width = 49
    Height = 13
    Caption = #1054#1090#1095#1077#1089#1090#1074#1086
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label33: TLabel [3]
    Left = 19
    Top = 177
    Width = 80
    Height = 13
    Caption = #1044#1072#1090#1072' '#1088#1086#1078#1076#1077#1085#1080#1103
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clGray
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    Visible = False
  end
  inherited sbBottom: TStatusBar
    Top = 478
    Width = 317
  end
  inherited Panel1: TPanel
    Width = 317
    Height = 33
    inherited BitBtn1: TBitBtn
      Left = 147
      Top = 4
    end
    inherited BitBtn2: TBitBtn
      Left = 235
      Top = 4
    end
  end
  object edPLASTNAME: TDBEdit [6]
    Left = 16
    Top = 56
    Width = 278
    Height = 27
    DataField = 'PLASTNAME'
    DataSource = dlgDS
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clBlack
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 2
  end
  object cbName: TcxDBLookupComboBox [7]
    Left = 16
    Top = 100
    DataBinding.DataField = 'PNAME'
    DataBinding.DataSource = dlgDS
    ParentFont = False
    Properties.DropDownListStyle = lsEditList
    Properties.KeyFieldNames = 'SDNAME'
    Properties.ListColumns = <
      item
        FieldName = 'SDNAME'
      end>
    Properties.ListSource = dsName
    Style.Font.Charset = DEFAULT_CHARSET
    Style.Font.Color = clWindowText
    Style.Font.Height = -16
    Style.Font.Name = 'Tahoma'
    Style.Font.Style = [fsBold]
    Style.IsFontAssigned = True
    TabOrder = 3
    OnExit = cbNameExit
    Width = 281
  end
  object edPPATRONYMIC: TDBEdit [8]
    Left = 16
    Top = 144
    Width = 281
    Height = 27
    DataField = 'PPATRONYMIC'
    DataSource = dlgDS
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clBlack
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 4
  end
  object edPDATEBIRTH: TcxDBDateEdit [9]
    Left = 18
    Top = 193
    DataBinding.DataField = 'PDATEBIRTH'
    DataBinding.DataSource = dlgDS
    ParentFont = False
    Style.Font.Charset = DEFAULT_CHARSET
    Style.Font.Color = clWindowText
    Style.Font.Height = -16
    Style.Font.Name = 'Tahoma'
    Style.Font.Style = [fsBold]
    Style.IsFontAssigned = True
    TabOrder = 5
    Visible = False
    Width = 135
  end
  object cxDBRadioGroup1: TcxDBRadioGroup [10]
    Left = 191
    Top = 176
    Caption = #1055#1086#1083
    DataBinding.DataField = 'PSEX'
    DataBinding.DataSource = dlgDS
    ParentFont = False
    Properties.Items = <
      item
        Caption = #1052#1091#1078#1089#1082#1086#1081
        Value = 0
      end
      item
        Caption = #1046#1077#1085#1089#1082#1080#1081
        Value = 1
      end>
    Style.Font.Charset = DEFAULT_CHARSET
    Style.Font.Color = clWindowText
    Style.Font.Height = -11
    Style.Font.Name = 'Tahoma'
    Style.Font.Style = [fsBold]
    Style.IsFontAssigned = True
    TabOrder = 6
    Height = 61
    Width = 105
  end
  object GroupBox1: TGroupBox [11]
    Left = 6
    Top = 245
    Width = 305
    Height = 228
    Caption = #1055#1072#1089#1087#1086#1088#1090#1085#1099#1077' '#1076#1072#1085#1085#1099#1077
    TabOrder = 7
    object Label11: TLabel
      Left = 15
      Top = 21
      Width = 31
      Height = 13
      Caption = #1057#1077#1088#1080#1103
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label12: TLabel
      Left = 160
      Top = 21
      Width = 31
      Height = 13
      Caption = #1053#1086#1084#1077#1088
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label13: TLabel
      Left = 8
      Top = 68
      Width = 68
      Height = 13
      Caption = #1044#1072#1090#1072' '#1074#1099#1076#1072#1095#1080
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object Label32: TLabel
      Left = 10
      Top = 120
      Width = 67
      Height = 13
      Align = alCustom
      Caption = #1050#1086#1084#1084#1077#1085#1090#1072#1088#1080#1081
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clGray
      Font.Height = -11
      Font.Name = 'Tahoma'
      Font.Style = []
      ParentFont = False
    end
    object edCLPASSPORTSERIA: TDBEdit
      Left = 7
      Top = 37
      Width = 138
      Height = 27
      DataField = 'DSERIA'
      DataSource = dsDocuments
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -16
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ParentFont = False
      TabOrder = 0
    end
    object edCLPASSPORTNUMBER: TDBEdit
      Left = 153
      Top = 37
      Width = 145
      Height = 27
      DataField = 'DNUMBER'
      DataSource = dsDocuments
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -16
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ParentFont = False
      TabOrder = 1
    end
    object edCLPASSPORTDATE: TcxDBDateEdit
      Left = 8
      Top = 85
      DataBinding.DataField = 'DDATE'
      DataBinding.DataSource = dsDocuments
      ParentFont = False
      Style.Font.Charset = DEFAULT_CHARSET
      Style.Font.Color = clBlack
      Style.Font.Height = -16
      Style.Font.Name = 'Tahoma'
      Style.Font.Style = [fsBold]
      Style.LookAndFeel.Kind = lfFlat
      Style.IsFontAssigned = True
      StyleDisabled.LookAndFeel.Kind = lfFlat
      StyleFocused.LookAndFeel.Kind = lfFlat
      StyleHot.LookAndFeel.Kind = lfFlat
      TabOrder = 2
      Width = 137
    end
    object mdDNOTE: TDBMemo
      Left = 10
      Top = 143
      Width = 288
      Height = 66
      Align = alCustom
      DataField = 'DNOTE'
      DataSource = dsDocuments
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -13
      Font.Name = 'Tahoma'
      Font.Style = [fsBold]
      ParentFont = False
      TabOrder = 3
    end
  end
  inherited dlgDS: TDataSource
    DataSet = qPeople
  end
  object qPeople: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterOpen = qPeopleAfterOpen
    CachedUpdates = True
    SQL.Strings = (
      
        'SELECT P.*, (P.PLASTNAME||'#39' '#39'||P.PNAME||'#39' '#39'||P.PPATRONYMIC) AS P' +
        '_full_name'
      '  FROM People P'
      ' WHERE P.PID = -1'
      '')
    UpdateObject = quPeople
    GeneratorField.Field = 'PID'
    GeneratorField.Generator = 'GEN_PEOPLE'
    Left = 112
    Top = 8
    object qPeoplePID: TIntegerField
      FieldName = 'PID'
      Origin = '"PEOPLE"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qPeoplePNAME: TIBStringField
      FieldName = 'PNAME'
      Origin = '"PEOPLE"."PNAME"'
      Size = 255
    end
    object qPeoplePLASTNAME: TIBStringField
      FieldName = 'PLASTNAME'
      Origin = '"PEOPLE"."PLASTNAME"'
      Size = 255
    end
    object qPeoplePPATRONYMIC: TIBStringField
      FieldName = 'PPATRONYMIC'
      Origin = '"PEOPLE"."PPATRONYMIC"'
      Size = 255
    end
    object qPeoplePDATEBIRTH: TDateField
      FieldName = 'PDATEBIRTH'
      Origin = '"PEOPLE"."PDATEBIRTH"'
    end
    object qPeoplePNOTE: TIBStringField
      FieldName = 'PNOTE'
      Origin = '"PEOPLE"."PNOTE"'
      Size = 2048
    end
    object qPeoplePUSERENTER: TIBStringField
      FieldName = 'PUSERENTER'
      Origin = '"PEOPLE"."PUSERENTER"'
      Size = 40
    end
    object qPeoplePTIMEENTER: TDateTimeField
      FieldName = 'PTIMEENTER'
      Origin = '"PEOPLE"."PTIMEENTER"'
    end
    object qPeoplePUSEREDIT: TIBStringField
      FieldName = 'PUSEREDIT'
      Origin = '"PEOPLE"."PUSEREDIT"'
      Size = 40
    end
    object qPeoplePTIMEEDIT: TDateTimeField
      FieldName = 'PTIMEEDIT'
      Origin = '"PEOPLE"."PTIMEEDIT"'
    end
    object qPeoplePISDELETE: TIntegerField
      FieldName = 'PISDELETE'
      Origin = '"PEOPLE"."PISDELETE"'
    end
    object qPeopleP_FULL_NAME: TIBStringField
      FieldName = 'P_FULL_NAME'
      ProviderFlags = []
      Size = 767
    end
    object qPeoplePSEX: TIntegerField
      FieldName = 'PSEX'
      Origin = '"PEOPLE"."PSEX"'
    end
  end
  object quPeople: TIBUpdateSQL
    ModifySQL.Strings = (
      'update PEOPLE'
      'set'
      '  PDATEBIRTH = :PDATEBIRTH,'
      '  PID = :PID,'
      '  PISDELETE = :PISDELETE,'
      '  PLASTNAME = :PLASTNAME,'
      '  PNAME = :PNAME,'
      '  PNOTE = :PNOTE,'
      '  PPATRONYMIC = :PPATRONYMIC,'
      '  PSEX = :PSEX,'
      '  PTIMEEDIT = :PTIMEEDIT,'
      '  PTIMEENTER = :PTIMEENTER,'
      '  PUSEREDIT = :PUSEREDIT,'
      '  PUSERENTER = :PUSERENTER'
      'where'
      '  PID = :OLD_PID')
    InsertSQL.Strings = (
      'insert into PEOPLE'
      
        '  (PDATEBIRTH, PID, PISDELETE, PLASTNAME, PNAME, PNOTE, PPATRONY' +
        'MIC, PSEX, '
      '   PTIMEEDIT, PTIMEENTER, PUSEREDIT, PUSERENTER)'
      'values'
      
        '  (:PDATEBIRTH, :PID, :PISDELETE, :PLASTNAME, :PNAME, :PNOTE, :P' +
        'PATRONYMIC, '
      '   :PSEX, :PTIMEEDIT, :PTIMEENTER, :PUSEREDIT, :PUSERENTER)')
    DeleteSQL.Strings = (
      '')
    Left = 144
    Top = 8
  end
  object dsName: TDataSource
    DataSet = qName
    Left = 144
    Top = 96
  end
  object qName: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    SQL.Strings = (
      'SELECT t1.*, SD1.SDISDELETE'
      'FROM'
      '('
      'WITH   recursive'
      '   tree (SDNAME, SDID, SDPARID, o)'
      
        '   AS (SELECT SD.SDNAME, SD.SDID, sd.SDPARID, CAST('#39#39' AS VARCHAR' +
        '(2048)) AS o FROM SYS_DIC SD'
      '      WHERE sd.SDPARID = 10'
      '      UNION ALL'
      '      SELECT SD1.SDNAME, SD1.SDID, sd1.SDPARID, '#39' '#39' || o'
      ''
      '      FROM SYS_DIC SD1'
      '          INNER JOIN tree t '
      '           ON t.sdid = sd1.SDPARID)'
      ' SELECT  o || SDNAME AS SDNAME, SDID, SDPARID FROM tree t'
      ') AS t1'
      'INNER JOIN SYS_DIC sd1 ON sd1.SDID = t1.sdid'
      'order by 1'
      '')
    GeneratorField.Field = 'SDID'
    Left = 184
    Top = 96
    object qNameSDID: TIntegerField
      FieldName = 'SDID'
      ProviderFlags = []
    end
    object qNameSDPARID: TIntegerField
      FieldName = 'SDPARID'
      ProviderFlags = []
    end
    object qNameSDNAME: TIBStringField
      DisplayLabel = ' '
      FieldName = 'SDNAME'
      ProviderFlags = []
      Size = 2304
    end
    object qNameSDISDELETE: TIntegerField
      DisplayLabel = #1059#1076#1072#1083#1080#1090#1100'?'
      FieldName = 'SDISDELETE'
      Origin = '"SYS_DIC"."SDISDELETE"'
    end
  end
  object dsDocuments: TDataSource
    DataSet = qDocuments
    Left = 184
    Top = 336
  end
  object qDocuments: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qDocumentsAfterInsert
    CachedUpdates = True
    DataSource = dlgDS
    SQL.Strings = (
      
        'SELECT PD.*, SD.SDID, SD.SDNAME, IIF (DS.DSID IS NULL, 0, 1) AS ' +
        'ISSCAN, DS.DSIMAGE'
      'FROM P_DOCUMENTS PD'
      'INNER JOIN SYS_DIC SD ON SD.SDID = PD.DTYPE'
      'LEFT OUTER JOIN D_SCAN DS ON DS.DID = PD.DID'
      'WHERE PD.PID = :PID'
      '        AND PD.DISDELETE IS NULL')
    UpdateObject = quDocuments
    GeneratorField.Field = 'DID'
    GeneratorField.Generator = 'GEN_P_DOCUMENTS'
    Left = 224
    Top = 336
    ParamData = <
      item
        DataType = ftInteger
        Name = 'PID'
        ParamType = ptUnknown
        Size = 4
      end>
    object qDocumentsDID: TIntegerField
      FieldName = 'DID'
      Origin = '"P_DOCUMENTS"."DID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qDocumentsPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_DOCUMENTS"."PID"'
    end
    object qDocumentsDTYPE: TIntegerField
      FieldName = 'DTYPE'
      Origin = '"P_DOCUMENTS"."DTYPE"'
    end
    object qDocumentsDSERIA: TIBStringField
      FieldName = 'DSERIA'
      Origin = '"P_DOCUMENTS"."DSERIA"'
      Size = 10
    end
    object qDocumentsDNUMBER: TIBStringField
      FieldName = 'DNUMBER'
      Origin = '"P_DOCUMENTS"."DNUMBER"'
      Size = 10
    end
    object qDocumentsDFROMWHO: TIBStringField
      FieldName = 'DFROMWHO'
      Origin = '"P_DOCUMENTS"."DFROMWHO"'
      Size = 255
    end
    object qDocumentsDDATE: TDateField
      FieldName = 'DDATE'
      Origin = '"P_DOCUMENTS"."DDATE"'
    end
    object qDocumentsDNOTE: TIBStringField
      FieldName = 'DNOTE'
      Origin = '"P_DOCUMENTS"."DNOTE"'
      Size = 255
    end
    object qDocumentsDUSERENTER: TIBStringField
      FieldName = 'DUSERENTER'
      Origin = '"P_DOCUMENTS"."DUSERENTER"'
      Size = 40
    end
    object qDocumentsDTIMEENTER: TDateTimeField
      FieldName = 'DTIMEENTER'
      Origin = '"P_DOCUMENTS"."DTIMEENTER"'
    end
    object qDocumentsDUSEREDIT: TIBStringField
      FieldName = 'DUSEREDIT'
      Origin = '"P_DOCUMENTS"."DUSEREDIT"'
      Size = 40
    end
    object qDocumentsDTIMEEDIT: TDateTimeField
      FieldName = 'DTIMEEDIT'
      Origin = '"P_DOCUMENTS"."DTIMEEDIT"'
    end
    object qDocumentsISSCAN: TIntegerField
      FieldName = 'ISSCAN'
      ProviderFlags = []
    end
    object qDocumentsDISDELETE: TIntegerField
      FieldName = 'DISDELETE'
      Origin = '"P_DOCUMENTS"."DISDELETE"'
    end
    object qDocumentsSDNAME: TIBStringField
      FieldName = 'SDNAME'
      Origin = '"SYS_DIC"."SDNAME"'
      Size = 255
    end
    object qDocumentsDSIMAGE: TBlobField
      FieldName = 'DSIMAGE'
      Origin = '"D_SCAN"."DSIMAGE"'
      ProviderFlags = [pfInUpdate]
      Size = 8
    end
    object qDocumentsDMAINDOC: TIntegerField
      FieldName = 'DMAINDOC'
      Origin = '"P_DOCUMENTS"."DMAINDOC"'
    end
  end
  object quDocuments: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  DID,'
      '  PID,'
      '  DMAINDOC,'
      '  DTYPE,'
      '  DSERIA,'
      '  DNUMBER,'
      '  DFROMWHO,'
      '  DDATE,'
      '  DNOTE,'
      '  DISDELETE,'
      '  DUSERENTER,'
      '  DTIMEENTER,'
      '  DUSEREDIT,'
      '  DTIMEEDIT,'
      '  SDID,'
      '  SDNAME,'
      '  ISSCAN,'
      '  DSIMAGE'
      'from P_DOCUMENTS '
      'where'
      '  DID = :DID')
    ModifySQL.Strings = (
      'update P_DOCUMENTS'
      'set'
      '  DDATE = :DDATE,'
      '  DFROMWHO = :DFROMWHO,'
      '  DID = :DID,'
      '  DISDELETE = :DISDELETE,'
      '  DMAINDOC = :DMAINDOC,'
      '  DNOTE = :DNOTE,'
      '  DNUMBER = :DNUMBER,'
      '  DSERIA = :DSERIA,'
      '  DTIMEEDIT = :DTIMEEDIT,'
      '  DTIMEENTER = :DTIMEENTER,'
      '  DTYPE = :DTYPE,'
      '  DUSEREDIT = :DUSEREDIT,'
      '  DUSERENTER = :DUSERENTER,'
      '  PID = :PID'
      'where'
      '  DID = :OLD_DID')
    InsertSQL.Strings = (
      'insert into P_DOCUMENTS'
      
        '  (DDATE, DFROMWHO, DID, DISDELETE, DMAINDOC, DNOTE, DNUMBER, DS' +
        'ERIA, DTIMEEDIT, '
      '   DTIMEENTER, DTYPE, DUSEREDIT, DUSERENTER, PID)'
      'values'
      
        '  (:DDATE, :DFROMWHO, :DID, :DISDELETE, :DMAINDOC, :DNOTE, :DNUM' +
        'BER, :DSERIA, '
      
        '   :DTIMEEDIT, :DTIMEENTER, :DTYPE, :DUSEREDIT, :DUSERENTER, :PI' +
        'D)')
    DeleteSQL.Strings = (
      'update P_DOCUMENTS'
      'set'
      '  DISDELETE = 1'
      'where'
      '  DID = :OLD_DID')
    Left = 264
    Top = 336
  end
  object quStatus: TIBUpdateSQL
    RefreshSQL.Strings = (
      'Select '
      '  PID,'
      '  SDID,'
      '  PSUSERENTER,'
      '  PSTIMEENTER,'
      '  PSUSEREDIT,'
      '  PSTIMEEDIT'
      'from P_STATUS '
      'where'
      '  PID = :PID')
    ModifySQL.Strings = (
      'update P_STATUS'
      'set'
      '  PID = :PID,'
      '  PSTIMEEDIT = :PSTIMEEDIT,'
      '  PSTIMEENTER = :PSTIMEENTER,'
      '  PSUSEREDIT = :PSUSEREDIT,'
      '  PSUSERENTER = :PSUSERENTER,'
      '  SDID = :SDID'
      'where'
      '  PID = :OLD_PID')
    InsertSQL.Strings = (
      'insert into P_STATUS'
      '  (PID, PSTIMEEDIT, PSTIMEENTER, PSUSEREDIT, PSUSERENTER, SDID)'
      'values'
      
        '  (:PID, :PSTIMEEDIT, :PSTIMEENTER, :PSUSEREDIT, :PSUSERENTER, :' +
        'SDID)')
    DeleteSQL.Strings = (
      'null;')
    Left = 152
    Top = 224
  end
  object qStatus: TIBQuery
    Database = DMInv.DBRead
    Transaction = DMInv.IBTransaction1
    AfterInsert = qStatusAfterInsert
    CachedUpdates = True
    DataSource = dlgDS
    SQL.Strings = (
      'SELECT PS.*'
      'FROM P_STATUS PS'
      'WHERE PS.PID = :PID'
      '')
    UpdateObject = quStatus
    GeneratorField.Field = 'SDID'
    Left = 120
    Top = 224
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'PID'
        ParamType = ptUnknown
      end>
    object qStatusPID: TIntegerField
      FieldName = 'PID'
      Origin = '"P_STATUS"."PID"'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object qStatusSDID: TIntegerField
      FieldName = 'SDID'
      Origin = '"P_STATUS"."SDID"'
    end
    object qStatusPSUSERENTER: TIBStringField
      FieldName = 'PSUSERENTER'
      Origin = '"P_STATUS"."PSUSERENTER"'
      Size = 80
    end
    object qStatusPSTIMEENTER: TDateTimeField
      FieldName = 'PSTIMEENTER'
      Origin = '"P_STATUS"."PSTIMEENTER"'
    end
    object qStatusPSUSEREDIT: TIBStringField
      FieldName = 'PSUSEREDIT'
      Origin = '"P_STATUS"."PSUSEREDIT"'
      Size = 40
    end
    object qStatusPSTIMEEDIT: TDateTimeField
      FieldName = 'PSTIMEEDIT'
      Origin = '"P_STATUS"."PSTIMEEDIT"'
    end
  end
end
